home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_14_Section Button.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.9 KB  |  65 lines

  1. property pSectionName, pGroupName, pInitialState, pIncludeRolloverState, ancestor
  2. global gGlobalObject
  3.  
  4. on beginSprite me
  5.   set previousItemDelimiter to the itemDelimiter
  6.   set the itemDelimiter to "."
  7.   set pSectionName to item 1 of the name of the member of sprite the spriteNum of me
  8.   set currentSectionName to item 1 of getLabel()
  9.   set the itemDelimiter to previousItemDelimiter
  10.   if pIncludeRolloverState then
  11.     set numTrans to 3
  12.   else
  13.     set numTrans to 2
  14.   end if
  15.   set togSty to 1
  16.   set togGrup to pGroupName
  17.   if currentSectionName = pSectionName then
  18.     set togState to #on
  19.   else
  20.     set togState to #off
  21.   end if
  22.   set togOffbl to 0
  23.   set selfTog to 1
  24.   set togOnOthOff to 1
  25.   set ancestor to new(script "Bitmap But 1", the spriteNum of me, numTrans, togSty, togGrup, togState, togOffbl, selfTog, togOnOthOff)
  26. end
  27.  
  28. on MouseUpAction me
  29.   SetPreviousSection()
  30.   go(pSectionName)
  31. end
  32.  
  33. on MouseDownAction me
  34.   nothing()
  35. end
  36.  
  37. on MouseEnterAction me
  38.   nothing()
  39. end
  40.  
  41. on MouseLeaveAction me
  42.   nothing()
  43. end
  44.  
  45. on getPropertyDescriptionList me
  46.   set description to [:]
  47.   addProp(description, #pIncludeRolloverState, [#default: 1, #format: #boolean, #comment: "Include Rollover State"])
  48.   addProp(description, #pGroupName, [#default: "SectionButtons", #format: #string, #comment: "Toggle Group Name"])
  49.   addProp(description, #pInitialState, [#default: #off, #format: #symbol, #comment: "Initial State", #range: [#off, #on]])
  50.   return description
  51. end
  52.  
  53. on getBehaviorDescription me
  54.   set endChar to offset("--END OF HEADER", the text of me)
  55.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  56.   set description to line 1 to endLine of the text of me
  57.   repeat with whichLine = endLine down to 1
  58.     if line whichLine of description = EMPTY then
  59.       delete line whichLine of description
  60.     end if
  61.   end repeat
  62.   delete line 1 of description
  63.   return description
  64. end
  65.